/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package busquedaAmplitud;

import java.util.ArrayList;
import java.util.List;

/**
 *
 *
 * Este metodo permite obtener los sucesores de un nodo dado
 */
public class SucesorA {

    public List<NodoA> hijos; //Lista de todos los hijos del estado padre
    public NodoA estadoPadre; //Nodo recibido que va a tener los sucesores
    //Constructor
    public SucesorA (NodoA padre){
        hijos = new ArrayList();
        estadoPadre = padre;
        estadoPadre.setCosto(padre.getCosto());
        estadoPadre.setId(padre.getId());
        estadoPadre.setIdPadre(padre.getIdPadre());
        estadoPadre.setNivel(padre.getNivel());
        System.out.println("Padre recibido");
        System.out.println(padre.getCosto());
        System.out.println(padre.getNivel());

    }
    //Metodo que determina los movimientos posibles para una posicion dada
    //cumple la misma fcion que en el caso del algoritmo primero en profundidad
private ArrayList movimientos(int x, int y){
        //ESTE METODO DEVUELVE LOS MOVIMIENTOS POSIBLES A EFECTUAR
        //POR CADA POSICION DEL CABALLO NEGRO SEGUN SU UBICACION
        ArrayList movs = new ArrayList();

        if((x==0)&&(y==0)){
            //cantidad de movimientos posibles: 2
            int[] mov1;
            mov1 = new int[2];
            mov1[0]=1; //fila
            mov1[1]=2; //columna
            int[]mov2;
            mov2 = new int[2];
            mov2[0]=2;
            mov2[1]=1;
            movs.add(mov1);
            movs.add(mov2);
        }
        //falta hacer por cada posicion del tablero

        if((x==0)&&(y==1)){
            int []mov1;
            int []mov2;
            int []mov3;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];

            mov1[0] = 2;
            mov1[1] = 0;

            mov2[0] = 2;
            mov2[1] = 2;

            mov3[0] = 1;
            mov3[1] = 3;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
        }

        if((x==0)&&(y==2)){
            int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 1;
            mov1[1] = 0;

            mov2[0] = 2;
            mov2[1] = 1;

            mov3[0] = 2;
            mov3[1] = 3;

            mov4[0] = 1;
            mov4[1] = 4;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);

        }

        if((x==0)&&(y==3)){
            int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 1;
            mov1[1] = 1;

            mov2[0] = 2;
            mov2[1] = 2;

            mov3[0] = 2;
            mov3[1] = 4;

            mov4[0] = 1;
            mov4[1] = 5;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==0)&&(y==4)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 1;
            mov1[1] = 2;

            mov2[0] = 2;
            mov2[1] = 3;

            mov3[0] = 2;
            mov3[1] = 5;

            mov4[0] = 1;
            mov4[1] = 6;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==0)&&(y==5)){
         int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 1;
            mov1[1] = 3;

            mov2[0] = 2;
            mov2[1] = 4;

            mov3[0] = 2;
            mov3[1] = 6;

            mov4[0] = 1;
            mov4[1] = 7;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==0)&&(y==6)){
        int []mov1;
            int []mov2;
            int []mov3;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];

            mov1[0] = 1;
            mov1[1] = 4;

            mov2[0] = 2;
            mov2[1] = 5;

            mov3[0] = 2;
            mov3[1] = 7;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
        }

        if((x==0)&&(y==7)){
            int []mov1;
            int []mov2;

            mov1 = new int[2];
            mov2 = new int[2];


            mov1[0] = 1;
            mov1[1] = 5;

            mov2[0] = 2;
            mov2[1] = 6;

            movs.add(mov1);
            movs.add(mov2);

        }

        if((x==1)&&(y==0)){
            int []mov1;
            int []mov2;
            int []mov3;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];

            mov1[0] = 0;
            mov1[1] = 2;

            mov2[0] = 2;
            mov2[1] = 2;

            mov3[0] = 3;
            mov3[1] = 1;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
        }

        if((x==1)&&(y==1)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 3;
            mov1[1] = 0;

            mov2[0] = 3;
            mov2[1] = 2;

            mov3[0] = 0;
            mov3[1] = 3;

            mov4[0] = 2;
            mov4[1] = 3;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==1)&&(y==2)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 0;
            mov1[1] = 0;

            mov2[0] = 2;
            mov2[1] = 0;

            mov3[0] = 3;
            mov3[1] = 1;

            mov4[0] = 3;
            mov4[1] = 3;

            mov5[0] = 2;
            mov5[1] = 4;

            mov6[0] = 0;
            mov6[1] = 4;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==1)&&(y==3)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 0;
            mov1[1] = 1;

            mov2[0] = 2;
            mov2[1] = 1;

            mov3[0] = 3;
            mov3[1] = 2;

            mov4[0] = 3;
            mov4[1] = 4;

            mov5[0] = 2;
            mov5[1] = 5;

            mov6[0] = 0;
            mov6[1] = 5;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==1)&&(y==4)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 0;
            mov1[1] = 2;

            mov2[0] = 2;
            mov2[1] = 2;

            mov3[0] = 3;
            mov3[1] = 3;

            mov4[0] = 3;
            mov4[1] = 5;

            mov5[0] = 2;
            mov5[1] = 6;

            mov6[0] = 0;
            mov6[1] = 6;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==1)&&(y==5)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 0;
            mov1[1] = 3;

            mov2[0] = 2;
            mov2[1] = 3;

            mov3[0] = 3;
            mov3[1] = 4;

            mov4[0] = 3;
            mov4[1] = 6;

            mov5[0] = 2;
            mov5[1] = 7;

            mov6[0] = 0;
            mov6[1] = 7;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==1)&&(y==6)){
            int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 0;
            mov1[1] = 4;

            mov2[0] = 2;
            mov2[1] = 4;

            mov3[0] = 3;
            mov3[1] = 5;

            mov4[0] = 3;
            mov4[1] = 7;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);

        }

        if((x==1)&&(y==7)){
        int []mov1;
            int []mov2;
            int []mov3;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];

            mov1[0] = 0;
            mov1[1] = 5;

            mov2[0] = 2;
            mov2[1] = 5;

            mov3[0] = 3;
            mov3[1] = 6;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);


        }

        if((x==2)&&(y==0)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 0;
            mov1[1] = 1;

            mov2[0] = 1;
            mov2[1] = 2;

            mov3[0] = 3;
            mov3[1] = 2;

            mov4[0] = 4;
            mov4[1] = 1;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==2)&&(y==1)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 0;
            mov1[1] = 0;

            mov2[0] = 0;
            mov2[1] = 2;

            mov3[0] = 1;
            mov3[1] = 3;

            mov4[0] = 3;
            mov4[1] = 3;

            mov5[0] = 4;
            mov5[1] = 0;

            mov6[0] = 4;
            mov6[1] = 2;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==2)&&(y==2)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 0;
            mov1[1] = 1;

            mov2[0] = 1;
            mov2[1] = 0;

            mov3[0] = 3;
            mov3[1] = 0;

            mov4[0] = 4;
            mov4[1] = 1;

            mov5[0] = 0;
            mov5[1] = 3;

            mov6[0] = 1;
            mov6[1] = 4;

            mov7[0] = 3;
            mov7[1] = 4;

            mov8[0] = 4;
            mov8[1] = 3;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==2)&&(y==3)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 0;
            mov1[1] = 2;

            mov2[0] = 1;
            mov2[1] = 1;

            mov3[0] = 3;
            mov3[1] = 1;

            mov4[0] = 4;
            mov4[1] = 2;

            mov5[0] = 0;
            mov5[1] = 4;

            mov6[0] = 1;
            mov6[1] = 5;

            mov7[0] = 3;
            mov7[1] = 5;

            mov8[0] = 4;
            mov8[1] = 4;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==2)&&(y==4)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 0;
            mov1[1] = 3;

            mov2[0] = 1;
            mov2[1] = 2;

            mov3[0] = 3;
            mov3[1] = 2;

            mov4[0] = 4;
            mov4[1] = 3;

            mov5[0] = 0;
            mov5[1] = 5;

            mov6[0] = 1;
            mov6[1] = 6;

            mov7[0] = 3;
            mov7[1] = 6;

            mov8[0] = 4;
            mov8[1] = 5;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==2)&&(y==5)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 0;
            mov1[1] = 4;

            mov2[0] = 1;
            mov2[1] = 3;

            mov3[0] = 3;
            mov3[1] = 3;

            mov4[0] = 4;
            mov4[1] = 4;

            mov5[0] = 0;
            mov5[1] = 6;

            mov6[0] = 1;
            mov6[1] = 7;

            mov7[0] = 3;
            mov7[1] = 7;

            mov8[0] = 4;
            mov8[1] = 6;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==2)&&(y==6)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 0;
            mov1[1] = 5;

            mov2[0] = 1;
            mov2[1] = 4;

            mov3[0] = 3;
            mov3[1] = 4;

            mov4[0] = 4;
            mov4[1] = 5;

            mov5[0] = 0;
            mov5[1] = 7;

            mov6[0] = 4;
            mov6[1] = 7;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==2)&&(y==7)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 0;
            mov1[1] = 6;

            mov2[0] = 1;
            mov2[1] = 5;

            mov3[0] = 3;
            mov3[1] = 5;

            mov4[0] = 4;
            mov4[1] = 6;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);

        }

        if((x==3)&&(y==0)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 1;
            mov1[1] = 1;

            mov2[0] = 2;
            mov2[1] = 2;

            mov3[0] = 4;
            mov3[1] = 2;

            mov4[0] = 5;
            mov4[1] = 1;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==3)&&(y==1)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 1;
            mov1[1] = 0;

            mov2[0] = 1;
            mov2[1] = 2;

            mov3[0] = 2;
            mov3[1] = 3;

            mov4[0] = 4;
            mov4[1] = 3;

            mov5[0] = 5;
            mov5[1] = 0;

            mov6[0] = 5;
            mov6[1] = 2;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==3)&&(y==2)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 2;
            mov1[1] = 0;

            mov2[0] = 1;
            mov2[1] = 1;

            mov3[0] = 1;
            mov3[1] = 3;

            mov4[0] = 2;
            mov4[1] = 4;

            mov5[0] = 4;
            mov5[1] = 0;

            mov6[0] = 5;
            mov6[1] = 1;

            mov7[0] = 4;
            mov7[1] = 4;

            mov8[0] = 5;
            mov8[1] = 3;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==3)&&(y==3)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 1;
            mov1[1] = 2;

            mov2[0] = 2;
            mov2[1] = 1;

            mov3[0] = 4;
            mov3[1] = 1;

            mov4[0] = 5;
            mov4[1] = 2;

            mov5[0] = 5;
            mov5[1] = 4;

            mov6[0] = 1;
            mov6[1] = 4;

            mov7[0] = 2;
            mov7[1] = 5;

            mov8[0] = 4;
            mov8[1] = 5;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==3)&&(y==4)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 1;
            mov1[1] = 3;

            mov2[0] = 2;
            mov2[1] = 2;

            mov3[0] = 4;
            mov3[1] = 2;

            mov4[0] = 5;
            mov4[1] = 3;

            mov5[0] = 1;
            mov5[1] = 5;

            mov6[0] = 2;
            mov6[1] = 6;

            mov7[0] = 4;
            mov7[1] = 6;

            mov8[0] = 5;
            mov8[1] = 5;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==3)&&(y==5)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 1;
            mov1[1] = 4;

            mov2[0] = 2;
            mov2[1] = 3;

            mov3[0] = 4;
            mov3[1] = 3;

            mov4[0] = 5;
            mov4[1] = 4;

            mov5[0] = 1;
            mov5[1] = 6;

            mov6[0] = 2;
            mov6[1] = 7;

            mov7[0] = 4;
            mov7[1] = 7;

            mov8[0] = 5;
            mov8[1] = 6;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==3)&&(y==6)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 1;
            mov1[1] = 5;

            mov2[0] = 2;
            mov2[1] = 4;

            mov3[0] = 4;
            mov3[1] = 4;

            mov4[0] = 1;
            mov4[1] = 7;

            mov5[0] = 5;
            mov5[1] = 5;

            mov6[0] = 5;
            mov6[1] = 7;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==3)&&(y==7)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 1;
            mov1[1] = 6;

            mov2[0] = 2;
            mov2[1] = 5;

            mov3[0] = 4;
            mov3[1] = 5;

            mov4[0] = 5;
            mov4[1] = 6;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);

        }

        if((x==4)&&(y==0)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 2;
            mov1[1] = 1;

            mov2[0] = 3;
            mov2[1] = 2;

            mov3[0] = 5;
            mov3[1] = 2;

            mov4[0] = 6;
            mov4[1] = 1;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==4)&&(y==1)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int[]mov5;
            int []mov6;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 2;
            mov1[1] = 0;

            mov2[0] = 2;
            mov2[1] = 2;

            mov3[0] = 3;
            mov3[1] = 3;

            mov4[0] = 5;
            mov4[1] = 3;

            mov5[0] = 6;
            mov5[1] = 0;

            mov6[0] = 6;
            mov6[1] = 2;


            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==4)&&(y==2)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 2;
            mov1[1] = 1;

            mov2[0] = 3;
            mov2[1] = 0;

            mov3[0] = 5;
            mov3[1] = 0;

            mov4[0] = 6;
            mov4[1] = 1;

            mov5[0] = 2;
            mov5[1] = 3;

            mov6[0] = 3;
            mov6[1] = 4;

            mov7[0] = 5;
            mov7[1] = 4;

            mov8[0] = 6;
            mov8[1] = 3;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==4)&&(y==3)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 2;
            mov1[1] = 2;

            mov2[0] = 3;
            mov2[1] = 1;

            mov3[0] = 5;
            mov3[1] = 1;

            mov4[0] = 6;
            mov4[1] = 2;

            mov5[0] = 2;
            mov5[1] = 4;

            mov6[0] = 3;
            mov6[1] = 5;

            mov7[0] = 5;
            mov7[1] = 5;

            mov8[0] = 6;
            mov8[1] = 4;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==4)&&(y==4)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 2;
            mov1[1] = 3;

            mov2[0] = 3;
            mov2[1] = 2;

            mov3[0] = 5;
            mov3[1] = 2;

            mov4[0] = 6;
            mov4[1] = 3;

            mov5[0] = 2;
            mov5[1] = 5;

            mov6[0] = 3;
            mov6[1] = 6;

            mov7[0] = 5;
            mov7[1] = 6;

            mov8[0] = 6;
            mov8[1] = 5;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==4)&&(y==5)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 2;
            mov1[1] = 4;

            mov2[0] = 3;
            mov2[1] = 3;

            mov3[0] = 5;
            mov3[1] = 3;

            mov4[0] = 6;
            mov4[1] = 4;

            mov5[0] = 2;
            mov5[1] = 6;

            mov6[0] = 3;
            mov6[1] = 7;

            mov7[0] = 5;
            mov7[1] = 7;

            mov8[0] = 6;
            mov8[1] = 6;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==4)&&(y==6)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int[]mov5;
            int []mov6;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 2;
            mov1[1] = 5;

            mov2[0] = 3;
            mov2[1] = 4;

            mov3[0] = 5;
            mov3[1] = 4;

            mov4[0] = 6;
            mov4[1] = 5;

            mov5[0] = 2;
            mov5[1] = 7;

            mov6[0] = 6;
            mov6[1] = 7;


            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==4)&&(y==7)){
            int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 2;
            mov1[1] = 6;

            mov2[0] = 3;
            mov2[1] = 5;

            mov3[0] = 5;
            mov3[1] = 5;

            mov4[0] = 6;
            mov4[1] = 6;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);

        }

        if((x==5)&&(y==0)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 3;
            mov1[1] = 1;

            mov2[0] = 4;
            mov2[1] = 2;

            mov3[0] = 6;
            mov3[1] = 2;

            mov4[0] = 7;
            mov4[1] = 1;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==5)&&(y==1)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int[]mov5;
            int []mov6;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 3;
            mov1[1] = 0;

            mov2[0] = 3;
            mov2[1] = 2;

            mov3[0] = 4;
            mov3[1] = 3;

            mov4[0] = 6;
            mov4[1] = 3;

            mov5[0] = 7;
            mov5[1] = 0;

            mov6[0] = 7;
            mov6[1] = 2;


            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==5)&&(y==2)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 4;
            mov1[1] = 0;

            mov2[0] = 3;
            mov2[1] = 1;

            mov3[0] = 3;
            mov3[1] = 3;

            mov4[0] = 4;
            mov4[1] = 4;

            mov5[0] = 6;
            mov5[1] = 4;

            mov6[0] = 7;
            mov6[1] = 3;

            mov7[0] = 7;
            mov7[1] = 1;

            mov8[0] = 6;
            mov8[1] = 0;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==5)&&(y==3)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 4;
            mov1[1] = 1;

            mov2[0] = 3;
            mov2[1] = 2;

            mov3[0] = 4;
            mov3[1] = 3;

            mov4[0] = 4;
            mov4[1] = 5;

            mov5[0] = 6;
            mov5[1] = 5;

            mov6[0] = 7;
            mov6[1] = 4;

            mov7[0] = 7;
            mov7[1] = 2;

            mov8[0] = 6;
            mov8[1] = 1;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }
        if((x==5)&&(y==4)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 4;
            mov1[1] = 2;

            mov2[0] = 3;
            mov2[1] = 3;

            mov3[0] = 3;
            mov3[1] = 5;

            mov4[0] = 4;
            mov4[1] = 6;

            mov5[0] = 6;
            mov5[1] = 6;

            mov6[0] = 7;
            mov6[1] = 5;

            mov7[0] = 7;
            mov7[1] = 3;

            mov8[0] = 6;
            mov8[1] = 2;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==5)&&(y==5)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int []mov5;
            int []mov6;
            int []mov7;
            int []mov8;
            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];
            mov7 = new int[2];
            mov8 = new int[2];

            mov1[0] = 4;
            mov1[1] = 3;

            mov2[0] = 3;
            mov2[1] = 4;

            mov3[0] = 3;
            mov3[1] = 6;

            mov4[0] = 4;
            mov4[1] = 7;

            mov5[0] = 6;
            mov5[1] = 7;

            mov6[0] = 7;
            mov6[1] = 6;

            mov7[0] = 7;
            mov7[1] = 4;

            mov8[0] = 6;
            mov8[1] = 3;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
            movs.add(mov7);
            movs.add(mov8);
        }

        if((x==5)&&(y==6)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int[]mov5;
            int []mov6;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 4;
            mov1[1] = 4;

            mov2[0] = 3;
            mov2[1] = 5;

            mov3[0] = 3;
            mov3[1] = 7;

            mov4[0] = 6;
            mov4[1] = 4;

            mov5[0] = 7;
            mov5[1] = 5;

            mov6[0] = 7;
            mov6[1] = 7;


            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==5)&&(y==7)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 3;
            mov1[1] = 6;

            mov2[0] = 4;
            mov2[1] = 5;

            mov3[0] = 7;
            mov3[1] = 6;

            mov4[0] = 6;
            mov4[1] = 5;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);

        }

        if((x==6)&&(y==0)){
            int []mov1;
            int []mov2;
            int []mov3;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];

            mov1[0] = 4;
            mov1[1] = 1;

            mov2[0] = 5;
            mov2[1] = 2;

            mov3[0] = 7;
            mov3[1] = 2;


            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);

        }

        if((x==6)&&(y==1)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 4;
            mov1[1] = 0;

            mov2[0] = 4;
            mov2[1] = 2;

            mov3[0] = 5;
            mov3[1] = 3;

            mov4[0] = 7;
            mov4[1] = 3;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==6)&&(y==2)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int[]mov5;
            int []mov6;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 5;
            mov1[1] = 0;

            mov2[0] = 4;
            mov2[1] = 1;

            mov3[0] = 4;
            mov3[1] = 3;

            mov4[0] = 5;
            mov4[1] = 4;

            mov5[0] = 7;
            mov5[1] = 0;

            mov6[0] = 7;
            mov6[1] = 4;


            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==6)&&(y==3)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int[]mov5;
            int []mov6;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 5;
            mov1[1] = 1;

            mov2[0] = 4;
            mov2[1] = 2;

            mov3[0] = 4;
            mov3[1] = 4;

            mov4[0] = 5;
            mov4[1] = 5;

            mov5[0] = 7;
            mov5[1] = 1;

            mov6[0] = 7;
            mov6[1] = 5;


            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==6)&&(y==4)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int[]mov5;
            int []mov6;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 5;
            mov1[1] = 2;

            mov2[0] = 4;
            mov2[1] = 3;

            mov3[0] = 4;
            mov3[1] = 5;

            mov4[0] = 5;
            mov4[1] = 6;

            mov5[0] = 7;
            mov5[1] = 6;

            mov6[0] = 7;
            mov6[1] = 2;


            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==6)&&(y==5)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;
            int[]mov5;
            int []mov6;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];
            mov5 = new int[2];
            mov6 = new int[2];

            mov1[0] = 5;
            mov1[1] = 3;

            mov2[0] = 4;
            mov2[1] = 4;

            mov3[0] = 4;
            mov3[1] = 6;

            mov4[0] = 5;
            mov4[1] = 7;

            mov5[0] = 7;
            mov5[1] = 3;

            mov6[0] = 7;
            mov6[1] = 7;


            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
            movs.add(mov5);
            movs.add(mov6);
        }

        if((x==6)&&(y==6)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 4;
            mov1[1] = 5;

            mov2[0] = 4;
            mov2[1] = 7;

            mov3[0] = 5;
            mov3[1] = 4;

            mov4[0] = 7;
            mov4[1] = 4;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==6)&&(y==7)){
        int []mov1;
            int []mov2;
            int []mov3;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];

            mov1[0] = 4;
            mov1[1] = 6;

            mov2[0] = 5;
            mov2[1] = 5;

            mov3[0] = 7;
            mov3[1] = 5;


            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);

        }

        if((x==7)&&(y==0)){
            int []mov1;
            int []mov2;

            mov1 = new int[2];
            mov2 = new int[2];

            mov1[0] = 5;
            mov1[1] = 1;

            mov2[0] = 6;
            mov2[1] = 2;

            movs.add(mov1);
            movs.add(mov2);

        }

        if((x==7)&&(y==1)){
        int []mov1;
            int []mov2;
            int []mov3;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];

            mov1[0] = 5;
            mov1[1] = 0;

            mov2[0] = 5;
            mov2[1] = 2;

            mov3[0] = 6;
            mov3[1] = 3;


            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
        }

        if((x==7)&&(y==2)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 6;
            mov1[1] = 0;

            mov2[0] = 5;
            mov2[1] = 1;

            mov3[0] = 5;
            mov3[1] = 3;

            mov4[0] = 6;
            mov4[1] = 4;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==7)&&(y==3)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 6;
            mov1[1] = 1;

            mov2[0] = 5;
            mov2[1] = 2;

            mov3[0] = 5;
            mov3[1] = 4;

            mov4[0] = 6;
            mov4[1] = 5;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==7)&&(y==4)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 6;
            mov1[1] = 2;

            mov2[0] = 5;
            mov2[1] = 3;

            mov3[0] = 5;
            mov3[1] = 5;

            mov4[0] = 6;
            mov4[1] = 6;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==7)&&(y==5)){
        int []mov1;
            int []mov2;
            int []mov3;
            int []mov4;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];
            mov4 = new int[2];

            mov1[0] = 6;
            mov1[1] = 3;

            mov2[0] = 5;
            mov2[1] = 4;

            mov3[0] = 5;
            mov3[1] = 6;

            mov4[0] = 6;
            mov4[1] = 7;

            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);
            movs.add(mov4);
        }

        if((x==7)&&(y==6)){
        int []mov1;
            int []mov2;
            int []mov3;

            mov1 = new int[2];
            mov2 = new int[2];
            mov3 = new int[2];

            mov1[0] = 5;
            mov1[1] = 5;

            mov2[0] = 5;
            mov2[1] = 7;

            mov3[0] = 6;
            mov3[1] = 4;


            movs.add(mov1);
            movs.add(mov2);
            movs.add(mov3);

        }

        if((x==7)&&(y==7)){
        int []mov1;
            int []mov2;


            mov1 = new int[2];
            mov2 = new int[2];


            mov1[0] = 5;
            mov1[1] = 6;

            mov2[0] = 6;
            mov2[1] = 5;

            movs.add(mov1);
            movs.add(mov2);
        }
        return movs;
    }
//Metodos para obtener un nuevo hijo aplicando cada una de las reglas definidas
//se hizo varios metodos para solucionar inconvenientes que se fueron presentando
//durante el desarrollo de la aplicacion
public boolean obtenerHijoRegla1(int cantHijo){

        int filaCn = 0;
        int colCn = 0;
        filaCn = this.getEstadoPadre().filaCN();
        colCn = this.getEstadoPadre().colCN();
        int nuevaFila = 0;
        int nuevaCol = 0;

        nuevaFila = filaCn + 1;
        nuevaCol = colCn + 2;
        boolean aplico1 = false;
        aplico1 = this.aplicarReglas(nuevaFila, nuevaCol, cantHijo);
        return aplico1;
}

public boolean obtenerHijoRegla2(int cantHijo){

        int filaCn = 0;
        int colCn = 0;
        filaCn = this.getEstadoPadre().filaCN();
        colCn = this.getEstadoPadre().colCN();
        int nuevaFila = 0;
        int nuevaCol = 0;
        nuevaFila = filaCn + 2;
        nuevaCol = colCn - 1;
        boolean aplico2 = false;
        aplico2 = this.aplicarReglas(nuevaFila, nuevaCol, cantHijo);
        return aplico2;
}

public boolean obtenerHijoRegla3(int cantHijo){

        int filaCn = 0;
        int colCn = 0;
        filaCn = this.getEstadoPadre().filaCN();
        colCn = this.getEstadoPadre().colCN();
        int nuevaFila = 0;
        int nuevaCol = 0;
        nuevaFila = filaCn + 2;
        nuevaCol = colCn - 1;
        boolean aplico3 = false;
        aplico3 = this.aplicarReglas(nuevaFila, nuevaCol, cantHijo);
        return aplico3;
}

public boolean obtenerHijoRegla4(int cantHijo){

        int filaCn = 0;
        int colCn = 0;
        filaCn = this.getEstadoPadre().filaCN();
        colCn = this.getEstadoPadre().colCN();
        int nuevaFila = 0;
        int nuevaCol = 0;
        nuevaFila = filaCn - 1;
        nuevaCol = colCn - 2;
        boolean aplico4 = false;
        aplico4 = this.aplicarReglas(nuevaFila, nuevaCol, cantHijo);
        return aplico4;
}

public boolean obtenerHijoRegla5(int cantHijo){

        int filaCn = 0;
        int colCn = 0;
        filaCn = this.getEstadoPadre().filaCN();
        colCn = this.getEstadoPadre().colCN();
        int nuevaFila = 0;
        int nuevaCol = 0;
        nuevaFila = filaCn - 2;
        nuevaCol = colCn + 1;
        boolean aplico5 = false;
        aplico5 = this.aplicarReglas(nuevaFila, nuevaCol, cantHijo);
        return aplico5;
}

public boolean obtenerHijoRegla6(int cantHijo){

        int filaCn = 0;
        int colCn = 0;
        filaCn = this.getEstadoPadre().filaCN();
        colCn = this.getEstadoPadre().colCN();
        int nuevaFila = 0;
        int nuevaCol = 0;
        nuevaFila = filaCn + 2;
        nuevaCol = colCn + 1;
        boolean aplico6 = false;
        aplico6 = this.aplicarReglas(nuevaFila, nuevaCol, cantHijo);
        return aplico6;
}

public boolean obtenerHijoRegla7(int cantHijo){

        int filaCn = 0;
        int colCn = 0;
        filaCn = this.getEstadoPadre().filaCN();
        colCn = this.getEstadoPadre().colCN();
        int nuevaFila = 0;
        int nuevaCol = 0;
        nuevaFila = filaCn + 1;
        nuevaCol = colCn - 2;
        boolean aplico7 = false;
        aplico7 = this.aplicarReglas(nuevaFila, nuevaCol, cantHijo);
        return aplico7;
}

public boolean obtenerHijoRegla8(int cantHijo){

        int filaCn = 0;
        int colCn = 0;
        filaCn = this.getEstadoPadre().filaCN();
        colCn = this.getEstadoPadre().colCN();
        int nuevaFila = 0;
        int nuevaCol = 0;
        nuevaFila = filaCn - 2;
        nuevaCol = colCn - 1;
        boolean aplico8 = false;
        aplico8 = this.aplicarReglas(nuevaFila, nuevaCol, cantHijo);
        return aplico8;
}

//Metodo que hace efectiva la aplicacion de las reglas
public boolean aplicarReglas(int nuevaFila, int nuevaCol, int idRecibido){
    boolean encontro = false;
    List <int []> movimiento;
    movimiento = new ArrayList();
    movimiento = this.movimientos(this.getEstadoPadre().filaCN(), this.getEstadoPadre().colCN());
    for(int i = 0; i<movimiento.size(); i++){
            int [] aux;
            aux = movimiento.get(i);
            if((aux[0] == nuevaFila)&&(aux[1]==nuevaCol)){
                encontro = true;
                // se puede aplicar el operador de movimiento

            }
        }
        if(encontro){
            //aplica la primer regla que puede
            NodoA hijo = new NodoA(this.getEstadoPadre().getPosicion(),this.estadoPadre.getId(),this.estadoPadre.getNivel()+1,idRecibido);
            hijo.modificarPosicion(this.getEstadoPadre().filaCN(), this.getEstadoPadre().colCN(), 0);
            hijo.modificarPosicion(nuevaFila, nuevaCol, 2);
            int [][] posAnterior;
            posAnterior = this.getEstadoPadre().getPosicion();
            if(posAnterior[nuevaFila][nuevaCol] == 1){

                hijo.calcularCostoNuevo(this.getEstadoPadre().getCosto(), 10);
                hijo.modificarPeso(nuevaFila, nuevaCol, 20);

            }else{

                hijo.calcularCostoNuevo(this.getEstadoPadre().getCosto(), 20);
                hijo.modificarPeso(nuevaFila, nuevaCol, 20);
            }
            this.getHijos().add(hijo);
        }
        return encontro;

    }

//Metodo que imprime por pantalla los hijos obtenidos
public void mostrarHijos(){

    for(int i=0;i<this.getHijos().size();i++){
            NodoA unHijo;
            unHijo = this.getHijos().get(i);
            int [][] elHijo;
            elHijo = unHijo.getPosicion();
            System.out.println("Hijo Nº"+i);
            System.out.println("Valores de su matriz de posicion");
            for(int j=0;j<8;j++){
                for(int k=0;k<8;k++){

                    System.out.print(elHijo[j][k]);
                }
                System.out.println();
            }
            System.out.println("Costo: "+unHijo.getCosto());
            System.out.println("Nivel:"+unHijo.getNivel());
            System.out.println("ID PADRE: "+unHijo.getIdPadre());
            System.out.println("NIVEL: "+unHijo.getNivel());
            System.out.println("ID: "+unHijo.getId());

 }

}

    //Setters y Getters
    public List<NodoA> getHijos() {
        return hijos;
    }

    /**
     * @param hijos the hijos to set
     */
    public void setHijos(List<NodoA> hijos) {
        this.hijos = hijos;
    }

    /**
     * @return the estadoPadre
     */
    public NodoA getEstadoPadre() {
        return estadoPadre;
    }

    /**
     * @param estadoPadre the estadoPadre to set
     */
    public void setEstadoPadre(NodoA estadoPadre) {
        this.estadoPadre = estadoPadre;
    }

}
